package Day34;

import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-11-03
 * Time: 20:02
 * To BE A Better Person-2020-3-2
 */
public class TestDemo2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);

        while(sc.hasNext()){
            int num=sc.nextInt();
            if(num <= 3){
                switch (num){
                    case 1:
                        System.out.println(0);
                        break;
                    case 2:
                        System.out.println(1);
                        break;
                    case 3:
                        System.out.println(1);
                        break;
                }
            }else{
                int fib1=0;
                int fib2=1;
                int fib3=1;
                while(num > 0){
                    int temp=fib3;
                    fib3+=temp+fib2;
                    fib1=fib2;
                    fib2=temp;
                    num--;
                }
                System.out.println(fib3);
            }



        }
    }
}
